﻿using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using GarageManagement.Domain.Model;

namespace GarageManagement.Data.Context
{
    public class GarageManagementContext : DbContext
    {
        public GarageManagementContext()
            : base("GarageManagement")
        {
        }

        public DbSet<Customer> Customers { get; set; }

        public virtual void Commit()
        {
            base.SaveChanges();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
